using System.ComponentModel.DataAnnotations;

namespace bookmeetingroom.ViewModel
{
    public class ChangePasswordViewModel
    {
        [Display(Name = "原密码")]
        [Required(ErrorMessage = "必填")]
        [StringLength(100, ErrorMessage = "{0}至少{2}位.", MinimumLength = 6)]
        [DataType(DataType.Password)]

        public string OldPassword { get; set; }
        [Display(Name = "新密码")]
        [Required(ErrorMessage = "必填")]
        [StringLength(100, ErrorMessage = "{0}至少{2}位.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        public string NewPassword { get; set; }

        [Display(Name = "确认新密码")]
        [Required(ErrorMessage = "必填")]
        [DataType(DataType.Password)]
        [StringLength(100, ErrorMessage = "{0}至少{2}位.", MinimumLength = 6)]
        [Compare("NewPassword", ErrorMessage = "两次输入的密码不匹配")]
        public string ConfirmPassword { get; set; }
    }
}